<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{position: absolute; left: 0; width: 200px;height: 100px;background-color: aqua;}
    </style>
</head>
<body>
    <div>123</div>
    <script>
        let div =document.querySelector('div')
       let timer= setInterval(() => {
            if (div.offsetLeft>=500) {
                clearInterval(timer)
            }
            div.style.left=div.offsetLeft+1+'px'
        }, 17);
    </script>
</body>
</html>